import apiUrl from '@/apis/urls/base'

/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
    noCache: true                if set true, the page will no be cached(default is false)
    affix: true                  if set true, the tag will affix in the tags-view
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
    beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
  }

 */

export default {
  type: 'get',
  url: apiUrl.systemMenu,
  response: [
    {
      path: '/',
      redirect: '/dashboard',
      children: [
        {
          path: 'dashboard',
          title: 'dashboard',
          icon: 'dashboard',
          component: '/dashboard/index',
          name: 'Dashboard',
          meta: { affix: true }
        }
      ]
    },
    {
      path: '/documentation',
      children: [
        {
          path: 'index',
          title: 'documentation',
          icon: 'documentation',
          component: '/documentation/index',
          name: 'Documentation',
          meta: { affix: true }
        }
      ]
    },
    {
      path: '/guide',
      redirect: '/guide/index',
      children: [
        {
          path: 'index',
          component: '/guide/index',
          title: 'guide',
          icon: 'guide',
          name: 'Guide',
          meta: { noCache: true }
        }
      ]
    },
    {
      path: '/permission',
      redirect: '/permission/page',
      alwaysShow: true,
      name: 'Permission',
      title: 'permission',
      icon: 'lock',
      permission: ['admin', 'editor'],
      children: [
        {
          path: 'page',
          component: '/permission/page',
          name: 'PagePermission',
          title: 'pagePermission',
          permission: ['admin'],
        },
        {
          path: 'directive',
          component: '/permission/directive',
          name: 'DirectivePermission',
          title: 'directivePermission',
        },
        {
          path: 'role',
          component: '/permission/role',
          name: 'RolePermission',
          title: 'rolePermission',
          permission: ['admin'],
        }
      ]
    },
    {
      path: '/icon',
      children: [
        {
          path: 'index',
          component: '/demo/icons',
          name: 'Icons',
          title: 'icons',
          icon: 'icon',
          meta: { noCache: true }
        }
      ]
    },
    {
      path: '/components',
      redirect: 'noRedirect',
      name: 'ComponentDemo',
      title: 'components',
      icon: 'component',
      children: [
        {
          path: 'tinymce',
          component: '/demo/tinymce',
          name: 'TinymceDemo',
          title: 'tinymce',
        },
        {
          path: 'markdown',
          component: '/demo/markdown',
          name: 'MarkdownDemo',
          title: 'markdown',
        },
        {
          path: 'json-editor',
          component: '/demo/json-editor',
          name: 'JsonEditorDemo',
          title: 'jsonEditor',
        },
        {
          path: 'split-pane',
          component: '/demo/split-pane',
          name: 'SplitpaneDemo',
          title: 'splitPane',
        },
        {
          path: 'avatar-upload',
          component: '/demo/avatar-upload',
          name: 'AvatarUploadDemo',
          title: 'avatarUpload',
        },
        {
          path: 'dropzone',
          component: '/demo/dropzone',
          name: 'DropzoneDemo',
          title: 'dropzone',
        },
        {
          path: 'sticky',
          component: '/demo/sticky',
          name: 'StickyDemo',
          title: 'sticky',
        },
        {
          path: 'count-to',
          component: '/demo/count-to',
          name: 'CountToDemo',
          title: 'countTo',
        },
        {
          path: 'mixin',
          component: '/demo/mixin',
          name: 'ComponentMixinDemo',
          title: 'componentMixin',
        },
        {
          path: 'back-to-top',
          component: '/demo/back-to-top',
          name: 'BackToTopDemo',
          title: 'backToTop',
        },
        {
          path: 'drag-dialog',
          component: '/demo/drag-dialog',
          name: 'DragDialogDemo',
          title: 'dragDialog',
        },
        {
          path: 'drag-select',
          component: '/demo/drag-select',
          name: 'DragSelectDemo',
          title: 'dragSelect',
        },
        {
          path: 'dnd-list',
          component: '/demo/dnd-list',
          name: 'DndListDemo',
          title: 'dndList',
        },
        {
          path: 'drag-kanban',
          component: '/demo/drag-kanban',
          name: 'DragKanbanDemo',
          title: 'dragKanban',
        }
      ]
    },
    {
      path: '/charts',
      redirect: 'noRedirect',
      name: 'Charts',
      title: 'charts',
      icon: 'chart',
      children: [
        {
          path: 'keyboard',
          component: '/charts/keyboard',
          name: 'KeyboardChart',
          title: 'keyboardChart',
          meta: { noCache: true }
        },
        {
          path: 'line',
          component: '/charts/line',
          name: 'LineChart',
          title: 'lineChart',
          meta: { noCache: true }
        },
        {
          path: 'mix-chart',
          component: '/charts/mix-chart',
          name: 'MixChart',
          title: 'mixChart',
          meta: { noCache: true }
        }
      ]
    },
    {
      path: '/nested',
      redirect: '/nested/menu1/menu1-1',
      name: 'Nested',
      title: 'nested',
      icon: 'nested',
      children: [
        {
          path: 'menu1',
          component: '/nested/menu1/index',
          name: 'Menu1',
          title: 'menu1',
          redirect: '/nested/menu1/menu1-1',
          children: [
            {
              path: 'menu1-1',
              component: '/nested/menu1/menu1-1',
              name: 'Menu1-1',
              title: 'menu1-1',
            },
            {
              path: 'menu1-2',
              component: '/nested/menu1/menu1-2',
              name: 'Menu1-2',
              redirect: '/nested/menu1/menu1-2/menu1-2-1',
              title: 'menu1-2',
              children: [
                {
                  path: 'menu1-2-1',
                  component: '/nested/menu1/menu1-2/menu1-2-1',
                  name: 'Menu1-2-1',
                  title: 'menu1-2-1',
                },
                {
                  path: 'menu1-2-2',
                  component: '/nested/menu1/menu1-2/menu1-2-2',
                  name: 'Menu1-2-2',
                  title: 'menu1-2-2',
                }
              ]
            },
            {
              path: 'menu1-3',
              component: '/nested/menu1/menu1-3',
              name: 'Menu1-3',
              title: 'menu1-3',
            }
          ]
        },
        {
          path: 'menu2',
          name: 'Menu2',
          component: '/nested/menu2/index',
          title: 'menu2',
        }
      ]
    },
    {
      path: '/table',
      redirect: '/table/complex-table',
      name: 'Table',
      title: 'Table',
      icon: 'table',
      children: [
        {
          path: 'dynamic-table',
          component: '/table/dynamic-table/index',
          name: 'DynamicTable',
          title: 'dynamicTable',
        },
        {
          path: 'drag-table',
          component: '/table/drag-table',
          name: 'DragTable',
          title: 'dragTable',
        },
        {
          path: 'inline-edit-table',
          component: '/table/inline-edit-table',
          name: 'InlineEditTable',
          title: 'inlineEditTable',
        },
        {
          path: 'complex-table',
          component: '/table/complex-table',
          name: 'ComplexTable',
          title: 'complexTable',
        }
      ]
    },
    {
      path: '/example',
      redirect: '/example/list',
      name: 'Example',
      title: 'example',
      icon: 'el-icon-s-help',
      children: [
        {
          path: 'create',
          component: '/example/create',
          name: 'CreateArticle',
          title: 'createArticle',
          icon: 'edit',
          meta: { beforeCloseName: 'before_close_normal' },
        },
        {
          path: 'edit/:id(\\d+)',
          component: '/example/edit',
          name: 'EditArticle',
          title: 'editArticle',
          meta: { noCache: true, activeMenu: '/example/list', beforeCloseName: 'before_close_normal' },
          hidden: true
        },
        {
          path: 'list',
          component: '/example/list',
          name: 'ArticleList',
          title: 'articleList',
          icon: 'list',
        }
      ]
    },
    {
      path: '/tab',
      children: [
        {
          path: 'index',
          component: '/tab/index',
          name: 'Tab',
          title: 'tab',
          icon: 'tab',
        }
      ]
    },
    {
      path: '/error',
      redirect: 'noRedirect',
      name: 'ErrorPages',
      title: 'errorPages',
      icon: '404',
      children: [
        {
          path: '401',
          component: '/error/401',
          name: 'Error401',
          title: 'page401',
          meta: { noCache: true }
        },
        {
          path: '404',
          component: '/error/404',
          name: 'Error404',
          title: 'page404',
          meta: { noCache: true }
        },
        {
          path: 'log',
          component: '/error/error-log',
          name: 'ErrorLog',
          title: 'errorLog',
          icon: 'bug',
        }
      ]
    },
    {
      path: '/excel',
      redirect: '/excel/export-excel',
      name: 'Excel',
      title: 'excel',
      icon: 'excel',
      children: [
        {
          path: 'export-excel',
          component: '/excel/export-excel',
          name: 'ExportExcel',
          title: 'exportExcel',
        },
        {
          path: 'export-selected-excel',
          component: '/excel/select-excel',
          name: 'SelectExcel',
          title: 'selectExcel',
        },
        {
          path: 'export-merge-header',
          component: '/excel/merge-header',
          name: 'MergeHeader',
          title: 'mergeHeader',
        },
        {
          path: 'upload-excel',
          component: '/excel/upload-excel',
          name: 'UploadExcel',
          title: 'uploadExcel',
        }
      ]
    },
    {
      path: '/zip',
      redirect: '/zip/download',
      alwaysShow: true,
      name: 'Zip',
      title: 'zip',
      icon: 'zip',
      children: [
        {
          path: 'download',
          component: '/zip/index',
          name: 'ExportZip',
          title: 'exportZip',
        }
      ]
    },
    {
      path: '/pdf',
      redirect: '/pdf/index',
      children: [
        {
          path: 'index',
          component: '/pdf/index',
          name: 'PDF',
          title: 'pdf',
          icon: 'pdf',
        }
      ]
    },
    {
      path: '/pdf/download',
      component: '/pdf/download',
      hidden: true
    },
    {
      path: '/theme',
      children: [
        {
          path: 'index',
          component: '/theme/index',
          name: 'Theme',
          title: 'theme',
          icon: 'theme',
        }
      ]
    },
    {
      path: '/clipboard',
      children: [
        {
          path: 'index',
          component: '/clipboard/index',
          name: 'ClipboardDemo',
          title: 'clipboardDemo',
          icon: 'clipboard',
        }
      ]
    },
    {
      path: '/i18n',
      children: [
        {
          path: 'index',
          component: '/demo/i18n/index',
          name: 'I18n',
          title: 'i18n',
          icon: 'international',
        }
      ]
    },
    {
      path: '/external-link',
      children: [
        {
          path: 'https://github.com/PanJiaChen/vue-element-admin',
          title: 'externalLink',
          icon: 'link',
        }
      ]
    },
    {
      path: '/profile',
      redirect: '/profile/index',
      hidden: true,
      children: [
        {
          path: 'index',
          component: '/profile/index',
          title: 'profile',
          icon: 'user',
          name: 'Profile',
          meta: { noCache: true }
        }
      ]
    }










  ]
}